<?php
/**
 * --------------------------------------------------------------
 * 配置验证器
 * --------------------------------------------------------------
 * Light Year Doc
 * @author yinq<3331653644@qq.com>
 * --------------------------------------------------------------
 */
namespace app\admin\validate;

use think\Validate;

class Config extends Validate
{
	// 定义验证规则
    protected $rule = [
        'group|配置分组' => 'require',
        'type|配置类型'  => 'require',
        'name|配置标识'  => 'require|regex:^[a-zA-Z]\w{0,39}$|unique:config',
        'title|配置名称' => 'require',
    ];

    // 定义验证提示
    protected $message = [
        'name.regex' => '配置标识由字母和下划线组成',
    ];
}